Source code: marauroa/net/MessageC2SLogout.java
1 /* $Id: MessageC2SLogout.java,v 1.2 2003/12/08 01:08:30 arianne_rpg Exp $ */
2 /***************************************************************************
3 * (C) Copyright 2003 - Marauroa *
4 ***************************************************************************
5 ***************************************************************************
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 ***************************************************************************/
13 package marauroa.net;
14
15 import java.net.InetSocketAddress;
16 import java.io.*;
17
18 /** The Logout Message is sent from client to server to indicate that it wants to
19 * finish the session. */
20 public class MessageC2SLogout extends Message
21 {
22 /** Constructor for allowing creation of an empty message */
23 public MessageC2SLogout()
24 {
25 super(null);
26
27 type=TYPE_C2S_LOGOUT;
28 }
29
30 /** Constructor with a TCP/IP source/destination of the message and the name
31 * of the choosen character.
32 * @param source The TCP/IP address associated to this message
33 */
34 public MessageC2SLogout(InetSocketAddress source)
35 {
36 super(source);
37
38 type=TYPE_C2S_LOGOUT;
39 }
40
41 /** This method returns a String that represent the object
42 * @return a string representing the object.*/
43 public String toString()
44 {
45 return "Message (C2S Logout) from ("+source.toString()+") CONTENTS: ()";
46 }
47
48 public void writeObject(marauroa.net.OutputSerializer out) throws IOException
49 {
50 super.writeObject(out);
51 }
52
53 public void readObject(marauroa.net.InputSerializer in) throws IOException, java.lang.ClassNotFoundException
54 {
55 super.readObject(in);
56
57 if(type!=TYPE_C2S_LOGOUT)
58 {
59 throw new java.lang.ClassNotFoundException();
60 }
61 }
62 };
63