public bool SendToAllUsers(ServerGame.Core.Connctions.PackSendData PackSendData, Interface.Connctions.ConnctionType ConnctionType, bool sendtoself, IUser userSender) { try { byte pramterhi = 0; foreach (var data in PackSendData.AllData) { if (pramterhi < data.PramterName) { pramterhi = data.PramterName; } } PackSendData.AllData.Add(new Data.Data(userSender.Name, ++pramterhi)); if (ServerGame.Interface.Connctions.ConnctionType.UDP == ConnctionType) { foreach (var user in this.UserInRoom) { if (user.ConnctionUDP.IPEndPointUDP != null) { if (userSender != user || sendtoself) { // PackSendData.AllData.Find(x => x.PramterName == pramterhi).DataSChange(userSender.Name); Connctions.Server.ServerOject.Sendudp(user.ConnctionUDP.workSocket, PackSendData, user.ConnctionUDP.IPEndPointUDP); } } } } else if (ServerGame.Interface.Connctions.ConnctionType.TCP == ConnctionType) { foreach (var user in this.UserInRoom) { if (!user.ConnctionTCP.workSocket.Poll(1000, System.Net.Sockets.SelectMode.SelectRead) || !(user.ConnctionTCP.workSocket.Available == 0)) { if (userSender != user || sendtoself) { // PackSendData.AllData.Find(x => x.PramterName == pramterhi).DataSChange(userSender.Name); Connctions.Server.ServerOject.Send(user.ConnctionTCP.workSocket, PackSendData); } } } } return(true); } catch (Exception e) { Console.WriteLine(e.ToString()); return(false); } }
public bool SendToAllZone(ServerGame.Core.Connctions.PackSendData PackSendData) { throw new NotImplementedException(); }
public bool SendToUser(ServerGame.Core.Connctions.PackSendData PackSendData, IUser User) { throw new NotImplementedException(); }
public bool SendToUsers(ServerGame.Core.Connctions.PackSendData PackSendData, List <IUser> ListUsers) { throw new NotImplementedException(); }
public static bool SendMessgeToAllUserInZoneBy(IZone IZone, ServerGame.Core.Connctions.PackSendData PackSendData) { throw new NotImplementedException(); }