Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #########################################################################
- # OpenKore - Packet sending
- # This module contains functions for sending packets to the server.
- #
- # This software is open source, licensed under the GNU General Public
- # License, version 2.
- # Basically, this means that you're allowed to modify and distribute
- # this software. However, if you distribute modified versions, you MUST
- # also distribute the source code.
- # See http://www.gnu.org/licenses/gpl.html for the full license.
- #
- # $Revision: 6687 $
- # $Id: kRO.pm 6687 2009-04-19 19:04:25Z technologyguild $
- ########################################################################
- #
- # Edited for client : 2011-01-11aRagexeRE
- #
- # Korea (kRO)
- # The majority of private servers use eAthena, this is a clone of kRO
- # this is an experimental class
- # this serverType is used for kRO Sakray RE
- # basically when we don't know where to put a new packet, we put it here and move it to the right class later
- package Network::Send::kRO::RagexeRE_0;
- use strict;
- use base qw(Network::Send::kRO::RagexeRE_2010_08_03a);
- use Time::HiRes qw(time);
- use Digest::MD5;
- use Network::Send ();
- use base qw(Network::Send);
- use Plugins;
- use Globals qw($accountID $sessionID $sessionID2 $accountSex $char $charID %config %guild @chars $masterServer $syncSync);
- use Log qw(debug);
- use Translation qw(T TF);
- use I18N qw(stringToBytes);
- use Utils;
- use Utils::Exceptions;
- sub new {
- my ($class) = @_;
- return $class->SUPER::new(@_);
- }
- sub sendGetCharacterName {
- my ($self, $ID) = @_;
- my $msg = pack("C*", 0x68, 0x03) . $ID;
- $self->sendToServer($msg);
- debug "Sent get character name: ID - ".getHex($ID)."\n", "sendPacket", 2;
- }
- sub sendGetPlayerInfo {
- my ($self, $ID) = @_;
- my $msg;
- $msg = pack("C*", 0x68, 0x03) . $ID;
- $self->sendToServer($msg);
- debug "Sent get player info: ID - ".getHex($ID)."\n", "sendPacket", 2;
- }
- sub sendChat {
- my ($self, $message) = @_;
- $message = "|00$message" if ($config{chatLangCode} && $config{chatLangCode} ne "none");
- my ($data, $charName); # Type: Bytes
- $message = stringToBytes($message); # Type: Bytes
- $charName = stringToBytes($char->{name}); # Type: Bytes
- #$charName = stringToBytes('Ndud'); # Type: Bytes
- $data = pack('v2 Z*', 0x00F3, length($charName) + length($message) + 8, $charName . " : " . $message);
- $self->sendToServer($data);
- }
- sub sendPrivateMsg {
- my ($self, $user, $message) = @_;
- $message = "|00$message" if ($config{chatLangCode} && $config{chatLangCode} ne "none");
- $message = stringToBytes($message); # Type: Bytes
- $user = stringToBytes($user); # Type: Bytes
- my $data = pack('v2 Z24 Z*', 0x0096, length($message) + 29, $user, $message);
- $self->sendToServer($data);
- }
- =pod
- =cut
- 1;
Advertisement
Add Comment
Please, Sign In to add comment