-
Notifications
You must be signed in to change notification settings - Fork 0
departmentMove
Leon edited this page Oct 17, 2022
·
1 revision
Emitted when user moves Department
-
Event
departmentMove
-
Event Receive Content
{ "userDepartmentID": 34, "userDepartmentName": "Feuerwache HH 15", "userDepartmentType": 1, "location": { "lat": 54.2512562, "lng": 16.481521 } }
-
Server Example
//Create user $user = User::fromUserID(14); //Create ReSiSocket $socket = ReSiSocket::getInstance(); //Get SocketID of User $userSocketCode = $user->getSocketID(); //Returns new UserVehicle $newUserDepartment = UserBuildingFactory::fromID(5); //Emit Vehicle Details of new UserVehicle to user with $userSocketID $socket->emitDepartmentMove($userSocketCode, $newUserDepartment->toBuyArray());
-
Client Example
socket.on("departmentMove", (departmentMoveObject) =>{ console.log(` User move ${departmentMoveObject.userDepartmentName} of type ${departmentMoveObject.userDepartmentType} to ${departmentMoveObject.location.lat} | ${departmentMoveObject.location.lng} (ID: ${departmentMoveObject.userDepartmentID}) `); });
- /aao/
- /address/
- /association/
- /backalarm/
- /buildings/
- /buyDepartment/
- /buyVehicle/
- /calculateDistance/
- /createCourse/
- /editDepartment/
- /editVehicle/
- /editVehicleGraphic/
- /editVehicleGraphicSet/
- /hoverCard/
- /latlng/
- /loadAssociationChatMessages/
- /markAssociationChatRead/
- /missions/
- /s5/
- /sellVehicle/
- /sendAssociationChatMessage/
- /sendCustomMissionLog/
- /shareMission/
- /upgradeDepartment/
- /user/
- /userBuildings/
- /userPersonal/
- /userVehicles/
- /vehicleCategories/
- /vehicleGraphicMarker/
- General
- Buildings
- Missions
- Vehicles
- Course
- Association