Ejemplo n.º 1
0
    public void StocMessage_Replay(BinaryReader r)
    {
        byte[]  data = r.ReadToEnd();
        Package p    = new Package();

        p.Fuction = (int)YGOSharp.OCGWrapper.Enums.GameMessage.sibyl_replay;
        p.Data    = new BinaryMaster();
        p.Data.writer.Write(data);
        TcpHelper.AddRecordLine(p);
        TcpHelper.SaveRecord();
    }
Ejemplo n.º 2
0
    public void AddChatMsg(string msg, int player)
    {
        string result = "";

        switch (player)
        {
        case -1:     //local name
            result += Program.I().selectServer.name;
            result += ":";
            break;

        case 0:     //from host
            result += Program.I().ocgcore.name_0;
            result += ":";
            break;

        case 1:     //from client
            result += Program.I().ocgcore.name_1;
            result += ":";
            break;

        case 2:     //host tag
            result += Program.I().ocgcore.name_0_tag;
            result += ":";
            break;

        case 3:     //client tag
            result += Program.I().ocgcore.name_1_tag;
            result += ":";
            break;

        case 7:     //---
            result += "[---]";
            result += ":";
            break;

        case 8:     //system custom message, no prefix.
            result += "[System]";
            result += ":";
            break;

        default:     //from watcher or unknown
            result += "[---]";
            result += ":";
            break;
        }
        result += msg;
        string res = "[888888]" + result + "[-]";

        Program.I().book.add(res);
        Package p = new Package();

        p.Fuction = (int)YGOSharp.OCGWrapper.Enums.GameMessage.sibyl_chat;
        p.Data    = new BinaryMaster();
        p.Data.writer.WriteUnicode(res, res.Length + 1);
        TcpHelper.AddRecordLine(p);
        switch ((PlayerType)player)
        {
        case PlayerType.Red:
            result = "[FF3030]" + result + "[-]";
            break;

        case PlayerType.Green:
            result = "[7CFC00]" + result + "[-]";
            break;

        case PlayerType.Blue:
            result = "[4876FF]" + result + "[-]";
            break;

        case PlayerType.BabyBlue:
            result = "[63B8FF]" + result + "[-]";
            break;

        case PlayerType.Pink:
            result = "[EED2EE]" + result + "[-]";
            break;

        case PlayerType.Yellow:
            result = "[EEEE00]" + result + "[-]";
            break;

        case PlayerType.White:
            result = "[FAF0E6]" + result + "[-]";
            break;

        case PlayerType.Gray:
            result = "[CDC9C9]" + result + "[-]";
            break;
        }
        RMSshow_none(result);
    }