sources/network/rconsession.cpp

branch
protocol5
changeset 131
4996c8684b93
parent 130
9f54db6f9922
parent 115
bb7ef7c33dad
child 136
8fb1c657e0b0
equal deleted inserted replaced
130:9f54db6f9922 131:4996c8684b93
1 /* 1 /*
2 Copyright 2014, 2015 Teemu Piippo 2 Copyright 2014 - 2016 Teemu Piippo
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions 6 modification, are permitted provided that the following conditions
7 are met: 7 are met:
71 { 71 {
72 // Say goodbye to remote 72 // Say goodbye to remote
73 Bytestream packet; 73 Bytestream packet;
74 packet.write_byte (CLRC_DISCONNECT); 74 packet.write_byte (CLRC_DISCONNECT);
75 this->send (packet); 75 this->send (packet);
76 m_interface->print ("Disconnected from %s\n", m_address.to_string (IPAddress::WITH_PORT).chars()); 76 m_interface->disconnected();
77 m_interface->update_statusbar();
78 } 77 }
79 78
80 m_state = RCON_DISCONNECTED; 79 m_state = RCON_DISCONNECTED;
81 } 80 }
82 81
163 162
164 case SVRC_MESSAGE: 163 case SVRC_MESSAGE:
165 { 164 {
166 String message = packet.read_string(); 165 String message = packet.read_string();
167 message.normalize(); 166 message.normalize();
168 m_interface->print ("%s\n", message.chars()); 167 m_interface->print_text ("%s\n", message.chars());
169 } 168 }
170 break; 169 break;
171 170
172 case SVRC_LOGGEDIN: 171 case SVRC_LOGGEDIN:
173 m_interface->print ("Login successful!\n"); 172 m_interface->print ("Login successful!\n");
183 182
184 for (int i = packet.read_byte(); i > 0; --i) 183 for (int i = packet.read_byte(); i > 0; --i)
185 { 184 {
186 String message = packet.read_string(); 185 String message = packet.read_string();
187 message.normalize(); 186 message.normalize();
188 m_interface->print ("--- %s\n", message.chars()); 187 m_interface->print_text ("--- %s\n", message.chars());
189 } 188 }
190 189
191 m_interface->print ("End of previous messages.\n"); 190 m_interface->print ("End of previous messages.\n");
192 191
193 // Watch sv_hostname so that we can update the titlebar when it changes. 192 // Watch sv_hostname so that we can update the titlebar when it changes.

mercurial