void SetTeachers(TmEntity entity) { TmSession session = entity.GetComponent <TmSession>(); if (TmObjects.Teachers.Count > 0 && session.IsLogin) { TmParameter response = TmParameterTool.ToJsonParameter(TenCode.Teacher, ElevenCode.SetSoulerDBs, ElevenCode.SetSoulerDBs.ToString(), TmObjects.Teachers); response.Keys.Add(entity.EcsId); TmTcpSocket.Instance.Send(response); Console.WriteLine(TmTimerTool.CurrentTime() + " TmTeacherDBSystem-Teachers: " + TmObjects.Teachers.Count); } }
void SetInventoryDBs(TmEntity entity) { TmSession session = entity.GetComponent <TmSession>(); if (session.InventoryDBs == null) { return; } if (session.inventorysChange != session.InventoryDBs.Count && session.InventoryDBs.Count > 0 && session.IsLogin) { TmParameter response = TmParameterTool.ToJsonParameter(TenCode.Knapsack, ElevenCode.SetIventoryDBs, ElevenCode.SetIventoryDBs.ToString(), session.InventoryDBs); response.Keys.Add(entity.EcsId); TmTcpSocket.Instance.Send(response); session.inventorysChange = session.InventoryDBs.Count; Console.WriteLine(TmTimerTool.CurrentTime() + " TmInventoryDBSystem-session.InventoryDBs:" + session.InventoryDBs.Count); } }
void SetEngineers(TmEntity entity) { TmSession session = entity.GetComponent <TmSession>(); session.Engineers = GetEngineersByMyself(session.Engineer, TmObjects.Engineers); session.Engineers.Remove(session.Engineer.Id); Console.WriteLine(TmTimerTool.CurrentTime() + " TmEngineerDBSystem-Id: " + session.Engineer.Id + " Engineers: " + session.Engineers.Count + "-" + TmObjects.Engineers.Count); if (session.Engineers.Count > 0 && session.IsLogin) { TmParameter response = TmParameterTool.ToJsonParameter(TenCode.Engineer, ElevenCode.SetSoulerDBs, ElevenCode.SetSoulerDBs.ToString(), session.Engineers); response.Keys.Add(entity.EcsId); TmTcpSocket.Instance.Send(response); } //if (session.engineersChange != session.Engineers.Count && session.IsLogin) //{ // session.engineersChange = session.Engineers.Count; //} }