protected override void OnConnected() { PETool.LogMsg("Client OnLine."); SendMsg(new NetMsg { text = "Welcome to connect!" }); }
protected override void OnReciveMsg(NetMsg msg) { PETool.LogMsg("Client Request:" + msg.text); SendMsg(new NetMsg { text = msg.text }); }
private void HandleReceiveMsg(NetMsg msg) { PETool.LogMsg("Client Request:" + msg.msgType + msg.text); switch (msg.msgType) { case MsgType.BroadcastAll: BroadcastAllClient(msg.text); break; case MsgType.BroadcastAllWithCurClient: BroadcastAllWithCurClient(msg.text, curSendClientSocket); break; case MsgType.Store: break; case MsgType.Default: break; default: break; } }
public void SndChat(MsgPack pack) { SndChat data = pack.Msg.sndChat; PlayerData pd = cacheSvc.GetPlayerDataBySession(pack.Session); //任务进度数据更新 TaskSys.Instance.CalcTaskPrgs(pd, 6); GameMsg msg = new GameMsg() { cmd = (int)CMD.PshChat, pshChat = new PshChat() { name = pd.name, chat = data.chat } }; //广播所有在线客户端 List <ServerSession> list = cacheSvc.GetOnlineServerSessions(); byte[] bytes = PETool.PackNetMsg(msg); for (int i = 0; i < list.Count; i++) { list[i].SendMsg(bytes); } }
/// <summary> /// 初始化 /// </summary> public void Init() { cacheSvc = CacheSvc.Instance; cfgSvc = CfgSvc.Instance; PETool.LogMsg("TaskSys Init Done."); }
public void Init() { PESocket <ServerSession, NetMsg> server = new PESocket <ServerSession, NetMsg>(); server.StartAsServer(IPConfig.srvIP, IPConfig.srvport); PETool.LogMsg("NetSvc init done"); //这个日志有时间 }
/// <summary> /// 初始化 /// </summary> public void Init() { cacheSvc = CacheSvc.Instance; timerSvc = TimerSvc.Instance; TimerSvc.Instance.AddTimeTask(CalcPowerAdd, PECommon.PowerAddSpace, PETimeUnit.Minute, 0); PETool.LogMsg("PowerSys Init Done."); }
/// <summary> /// 建立连接 /// </summary> protected override void OnConnected() { PETool.LogMsg("Client Connect"); SendMsg(new NetMsg { text = "welcome to connect:" }); }
protected override void OnReciveMsg(NetMsg msg) { base.OnReciveMsg(msg); PETool.LogMsg("Receieved CMD:" + msg.cmd); MsgPack msgPack = new MsgPack(msg, this); NetSvc.Instance.AddMsyQue(msgPack); }
public void Init() { PESocket <ServerSession, GameMsg> server = new PESocket <ServerSession, GameMsg>(); server.StartAsServer(SerCfg.serIP, SerCfg.serProt); PETool.LogMsg("NetSer Init Done"); }
static void Main(string[] args) { var petool = new PETool(); petool.Read(@"d:\hawkaoc\aoc\language.dll"); petool.Layout(); petool.WriteFile(@"d:\hawkaoc\aoc\`language.dll"); Console.ReadKey(); }
/// <summary> /// 广播所有客户端 /// </summary> /// <param name="msgStr">消息内容</param> private void BroadcastAllClient(string msgStr) { List <ServerSession> sessionLst = ServerStart.server.GetSesstionLst(); for (int i = 0; i < sessionLst.Count; i++) { PETool.LogMsg("Client AddressFamily sessionLst:" + sessionLst[i].GetClientSocket().RemoteEndPoint); sessionLst[i].SendMsg(new NetMsg { text = msgStr }); } }
void patch_exes_for_large_address_support() { List <string> files_to_patch = new List <string> { "h2tool", "h2sapien" }; PETool pe = new PETool(); foreach (string file in files_to_patch) { if (!File.Exists(H2Ek_install_path + file + ".large_address.exe") && File.Exists(H2Ek_install_path + file + ".exe")) { pe.Read(H2Ek_install_path + file + ".exe"); pe.fileHeader.Characteristics |= PECharacteristics.IMAGE_FILE_LARGE_ADDRESS_AWARE; pe.UpdateHeader(); pe.WriteFile(H2Ek_install_path + file + ".large_address.exe"); } } }
protected override void OnDisConnected() { base.OnDisConnected(); PETool.LogMsg("Client DisConnected"); }
protected override void OnDisConnected() { PETool.LogMsg("Client OffLine."); }
public static void Log(string msg, LogType logType = LogType.None) { LogLevel lv = (LogLevel)logType; PETool.LogMsg(msg, lv); }
public static void Log(string msg = "", LogType tp = LogType.Log) { LogLevel lv = (LogLevel)tp; PETool.LogMsg(msg, lv); }
protected override void OnDisConnected() { PETool.LogMsg("断开服务器连接"); }
protected override void OnReciveMsg(NetMsg msg) { PETool.LogMsg("Server Response:" + msg.text); }
protected override void OnReciveMsg(GameMsg msg) { PETool.LogMsg("接收到服务器的数据包,操作码为:" + ((CMD)msg.cmd).ToString()); NetSvc.Instance.AddNetPkg(msg); // 将接收到的数据包加到消息队列里 }
protected override void OnConnected() { PETool.LogMsg("Connect Server Succ."); }
public static void Log(string msg, LogType _type = LogType.Log) { LogLevel lv = (LogLevel)_type; PETool.LogMsg(msg, lv); }
public override void Init() { PETool.LogMsg("LoginSys Init Done"); }
protected override void OnReciveMsg(NetMsg msg) { PETool.LogMsg("Server Response:" + msg.text); MsgPool.Instance.AddMsg(msg.text); }
public static void Log(string msg = "", NETLogLevel lv = NETLogLevel.Log) { LogLevel level = (LogLevel)lv; PETool.LogMsg(msg, level); }
public static void Log(string msg = "", LogType logType = LogType.Log) { LogLevel level = (LogLevel)logType; PETool.LogMsg(msg, level); }
/// <summary> /// 初始化 /// </summary> public void Init() { cacheSvc = CacheSvc.Instance; PETool.LogMsg("BuySys Init Done."); }
/// <summary> /// 初始化 /// </summary> public void Init() { cacheSvc = CacheSvc.Instance; timerSvc = TimerSvc.Instance; PETool.LogMsg("LoginSys Init Done."); }
protected override void OnDisConnected() { PETool.LogMsg("Server Shutdown."); }
protected override void OnConnected() { PETool.LogMsg("连接服务器成功"); }