public override void ExecuteCommand(string userId, string command) { ClientUserSettingCmd settingData = deserialize.Deserialize <ClientUserSettingCmd>(command); if (settingData == null) { return; } if (Server.ServerDbHelper.GetInstance().EditUserSetting(dbUserId, settingData.UserSetting.gridX, settingData.UserSetting.gridY, settingData.UserSetting.isSnap)) { ServerUserSetting userSetting = new ServerUserSetting() { UserSetting = new Session.Data.SubData.UserSetting() { gridX = settingData.UserSetting.gridX, gridY = settingData.UserSetting.gridY, isSnap = settingData.UserSetting.isSnap, } }; // TODO: should notify all connected login user with same id // notify user server.GetConnectionMgr().SendData( (int)CommandConst.MainCommandServer.UserPriviledge, (int)CommandConst.SubCommandServer.UserSetting, userSetting, new List <string>() { userId }); } }
public void EditUserSettings(int newGridX, int newGridY, bool newSnap) { ClientUserSettingCmd clientUserSettingCmd = new ClientUserSettingCmd() { UserSetting = new UserSetting() { gridX = newGridX, gridY = newGridY, isSnap = newSnap, } }; connectionMgr.BroadcastMessage( (int)CommandConst.MainCommandClient.LoginInfo, (int)CommandConst.SubCommandClient.UserSetting, clientUserSettingCmd); }