예제 #1
0
파일: Chat.cs 프로젝트: sam2/Pubstars2
        /// <summary>
        /// Send a message to chat
        /// </summary>
        /// <param name="message">the message to send, only the first 63 characters will be shown</param>
        public static void SendMessage(string message)
        {
            int count = MessageCount + 1;

            if (message.Length > 63)
            {
                message = message.Substring(0, 63);
            }

            int msgOffset       = MESSAGES + count * MESSAGE_SIZE;
            int offset2         = msgOffset - 0x40;
            int msgIndexOffset  = msgOffset - 0x20;
            int msgLengthOffset = msgOffset - 0x1C;

            MemoryEditor.WriteInt(2, offset2);
            MemoryEditor.WriteInt(-1, msgIndexOffset);
            MemoryEditor.WriteInt(message.Length, msgLengthOffset);
            MemoryEditor.WriteString(message, msgOffset);

            MessageCount = count;
        }
예제 #2
0
파일: Chat.cs 프로젝트: sam2/Pubstars2
 /// <summary>
 /// Removes the last command from game memory. Usefull when checking if there is a new command
 /// </summary>
 public static void FlushLastCommand()
 {
     MemoryEditor.WriteInt(-1, COMMAND_SOURCE);
     MemoryEditor.WriteString(" \0", COMMAND);
 }