예제 #1
0
        public static void SendNetMessageClient(int msg, int client, params object[] param)
        {
            try
            {
                if (Main.netMode == NetmodeID.SinglePlayer)
                {
                    return;
                }

                BaseNet.WriteToPacket(AAMod.instance.GetPacket(), (byte)msg, param).Send(client);
            }
            catch (Exception e)
            {
                string mode = Main.netMode == NetmodeID.Server ? "--SERVER-- " : "--CLIENT-- ";
                AAMod.instance.Logger.Error($"{mode} ERROR SENDING MSG: {msg}: {e.Message}");
                AAMod.instance.Logger.Info(e.StackTrace);
                AAMod.instance.Logger.Info("-------");

                string param2 = "";
                for (int m = 0; m < param.Length; m++)
                {
                    param2 += param[m];
                }

                AAMod.instance.Logger.Info("PARAMS: " + param2);
                AAMod.instance.Logger.Info("-------");
            }
        }
예제 #2
0
파일: MNet.cs 프로젝트: CC-png-byte/AAMod
 public static void SendBaseNetMessage(int msg, params object[] param)
 {
     if (Main.netMode == 0)
     {
         return;
     }                                              //nothing to sync in SP
     BaseNet.WriteToPacket(AAMod.instance.GetPacket(), (byte)msg, param).Send();
 }