Beispiel #1
0
        public static void FriendsAddTest()
        {
            ClientProcessing cp = new ClientProcessing();
            int id  = cp.AddActiveUser();
            int id1 = cp.AddActiveUser();

            Console.WriteLine(cp.Login("Username:test1$$Password:test1234$$", id));
            Console.WriteLine(cp.Login("Username:test2$$Password:test1234$$", id1));

            string pk  = BigInteger.Parse("1572974685565517564760848834612061204603051782958757453266089894").ToString("X");
            string pri = BigInteger.Parse("2171516053468561523083790486470955343976023523132159054917711086").ToString("X");
            string iv  = BigInteger.Parse("48040271114089576525052332491161").ToString("X");

            Console.WriteLine(cp.AddFriend("SecondUserName:test2$$", id));
            Console.WriteLine(cp.DhExchange(String.Format("InvitationID:1$$PK:{0}$$PrivateK:{1}$$IV:{2}$$", pk, pri, iv), id));
            Console.WriteLine(cp.SendInvitations("", id1));
            Console.WriteLine(cp.AcceptFriend("InvitationID:1$$PKB:4$$", id1));
            Console.WriteLine(cp.SendConversationKey("ConversationID:1$$ConversationKey:ytyt$$", id1));


            Console.WriteLine(cp.SendAcceptedFriends("", id));
            Console.WriteLine(cp.SendConversationKey("ConversationID:1$$ConversationKey:ytyoit$$", id));
        }
Beispiel #2
0
        public static void MessageTest()
        {
            ClientProcessing cp = new ClientProcessing();
            int id  = cp.AddActiveUser();
            int id1 = cp.AddActiveUser();

            cp.Login("Username:test8$$Password:test1234$$", id);
            cp.Login("Username:test7$$Password:12345678$$", id1);


            Console.WriteLine(cp.ActivateConversation("ConversationID:6$$", id));
            Console.WriteLine(cp.NewMessages("", id));
            Message m = new Message {
                date = DateTime.Now, message = "test", username = "******"
            };
            string s = JsonConvert.SerializeObject(m);

            Console.WriteLine(cp.SendMessage(String.Format("Username:test7$$Data:{0}$$", s), id));
            Console.WriteLine(cp.SendMessage(String.Format("Username:test7$$Data:{0}$$", s), id));
            Console.WriteLine(cp.Notification("", id1));
            Console.WriteLine(cp.Notification("", id1));
            Console.WriteLine(cp.ActivateConversation("ConversationID:6$$", id1));
            Console.WriteLine(cp.NewMessages("", id1));
        }
Beispiel #3
0
 public static string Login(int clientId, string name, string password, ClientProcessing cp)
 {
     return(cp.Login(MessageProccesing.CreateMessage <Login>(Options.LOGIN, new Login(name, password)), clientId));
 }