Ir para conteúdo
  • Cadastre-se

[C#] Client Class Poblem


Posts Recomendados

Bom galera estava tentando programar um poco em C# pra ve se e dahorinha porem so tem um erro

crie a Client.cs (Class) porem esta dando esse erro


Error 1 Missing partial modifier on declaration of type 'Client'; another partial declaration of this type exists

mais nao consigo arrumar alguem poderia me ajudar ? Client.cs Class Completa:

using Microsoft.VisualBasic;

using System;

using System.Collections;

using System.Collections.Generic;

using System.Data;

using System.Diagnostics;

class Client

{

#region "Public As"

private Process withEventsField_Process;

public Process Process {

  get { return withEventsField_Process; }

  set {

   if (withEventsField_Process != null) {

    withEventsField_Process.Exited -= Process_Exited;

   }

   withEventsField_Process = value;

   if (withEventsField_Process != null) {

    withEventsField_Process.Exited += Process_Exited;

   }

  }

}

public IntPtr Handle;

public int AdressOffset;

  #endregion

public InputHelper Input;

#region "Player Adress 9.44"

  // 9.44

int PlayerExp = 0x3abf98;

  // 9.44

int PlayerId = 0x978ea4;

  // 9.44

int Healthadr = 0x541000;

  // 9.44

int Manaadr = 0x3abfe0;

  // 9.44

int HealthMaxadr = 0x578e9c;

  // 9.44

int ManaMaxadr = 0x3abf90;

#endregion

#region "Battlelist Adress"

  // 9.44

int gotoX = 0x978ea0;

  // 9.44

int gotoY = 0x978e98;

  // 9.44

int gotoZ = 0x941004;

  // 9.44

int BattleListStart = 0x941008;

#endregion

#region "Client Adress"

  // 9.44

int ClientStatus = 0x7b5d4c;

  // 9.44

int clickId = 0x93e400;

#endregion

#region "Others Declarations"

public event ConnectionStatusChangedEventHandler ConnectionStatusChanged;

public delegate void ConnectionStatusChangedEventHandler();

public bool running = true;

private byte lastStatus;

  #endregion

public Client(Process _process, ClientChooser mainform)

{

  ConnectionStatusChanged += Client_ConnectionStatusChanged;

  Process = _process;

  Process.EnableRaisingEvents = true;

  Handle = Util.WinApi.OpenProcess(Util.WinApi.PROCESS_ALL_ACCESS, 0, Convert.ToUInt32(_process.Id));

  AdressOffset = Process.MainModule.BaseAddress.ToInt32() - 0x400000;

  Input = new InputHelper(this);

  this.MainForm = mainform;

  this.MenuF = MenuF;

  lastStatus = ReadByte(ClientStatus);

  if (lastStatus == 8) {

   mainform.CharListBox.Items.Add(this);

  }

  mainform.ClientList.Add(Process.Id);

  System.Threading.Thread t = new System.Threading.Thread(CheckStatus);

  t.Start();

}

private void CheckStatus()

{

  while (running) {

   if (lastStatus == 8) {

    byte currentStatus = ReadByte(ClientStatus);

    if (currentStatus != lastStatus) {

	 lastStatus = currentStatus;

	 if (ConnectionStatusChanged != null) {

	  ConnectionStatusChanged();

	 }

	 System.Threading.Thread.Sleep(300);

    }

   } else if (lastStatus == 0) {

    byte currentStatus = ReadByte(ClientStatus);

    if (currentStatus != lastStatus) {

	 lastStatus = currentStatus;

	 if (ConnectionStatusChanged != null) {

	  ConnectionStatusChanged();

	 }

	 System.Threading.Thread.Sleep(300);

    }

   }

  }

}

public int GetPlayerAdr()

{

  int steps = 0xb0;

  int Max = 1300;

  int ends = BattleListStart + (steps * Max);

  for (int i = BattleListStart; i <= ends; i += steps) {

   if (ReadInt(i) == ReadInt(PlayerId)) {

    return i;

   }

  }

  return 0;

}

public string getName {

  get { return ReadString(GetPlayerAdr() + 4); }

}

public int LastClickId()

{

  return ReadByte(clickId);

}

public bool IsOnline()

{

  if (ReadByte(ClientStatus) == 8) {

   return true;

  }

  return false;

}

public override string ToString()

{

  if (ReadByte(ClientStatus) == 8) {

   return ReadString(GetPlayerAdr() + 4);

  } else {

   return "NotLoggedIn";

  }

}

public int Mana {

  get { return ReadInt(Manaadr); }

}

public int Hp {

  get { return ReadInt(Healthadr); }

}

public int ManaMax {

  get { return ReadInt(ManaMaxadr); }

}

public int HpMax {

  get { return ReadInt(HealthMaxadr); }

}

#region "Memory"

public string ReadString(uint adr)

{

  return Util.Memory.ReadString(Handle, AdressOffset + adr);

}

public int ReadInt(uint adr)

{

  return Util.Memory.ReadInt32(Handle, AdressOffset + adr);

}

public byte ReadByte(uint adr)

{

  return Util.Memory.ReadByte(Handle, AdressOffset + adr);

}

public void WriteInt(uint adr, int value)

{

  Util.Memory.WriteInt32(Handle, AdressOffset + adr, value);

}

public void WriteByte(uint adr, byte value)

{

  Util.Memory.WriteByte(Handle, AdressOffset + adr, value);

}

public void WriteString(uint adr, string value)

{

  Util.Memory.WriteString(Handle, AdressOffset + adr, value);

}

#endregion

private void Process_Exited(object sender, System.EventArgs e)

{

  running = false;

  ClientChooser.CharListBox.Items.Remove(this);

  ClientChooser.ClientList.Remove(Process.Id);

}

private void Client_ConnectionStatusChanged()

{

  if (lastStatus == 0) {

   ClientChooser.CharListBox.Items.Remove(this);

  } else {

   while (ReadByte(ClientStatus) != 8) {

    System.Threading.Thread.Sleep(100);

   }

   ClientChooser.CharListBox.Items.Add(this);

  }

}

}

tk-melhor.png

KIIZH.png

Link para o post
Compartilhar em outros sites

Tipo la estava eu no C# e VB.Net pois eu converti no site , ai saiu isso pois falava que estava errado o class client tentei mudar public class Client , tbm dava o mesmo erro , nao tentei testar.

okayguy.jpg

tk-melhor.png

KIIZH.png

Link para o post
Compartilhar em outros sites


Public Class Client

#Region "Public As"

    Public MainForm As ClientChooser

    Public MenuF As frmMenu

    Public WithEvents Process As Process

    Public Handle As IntPtr

    Public AdressOffset As Integer

    Public Input As InputHelper

#End Region

#Region "Player Adress 9.44"

    Dim PlayerExp As Integer = &H3ABF98 ' 9.44

    Dim PlayerId As Integer = &H978EA4 ' 9.44 Player name on clientchooser

    Dim Healthadr As Integer = &H541000 ' 9.44

    Dim Manaadr As Integer = &H3ABFE0 ' 9.44

    Dim HealthMaxadr As Integer = &H578E9C ' 9.44

    Dim ManaMaxadr As Integer = &H3ABF90 ' 9.44

#End Region

#Region "Battlelist Adress"

    Dim gotoX As Integer = &H978EA0 ' 9.44

    Dim gotoY As Integer = &H978E98 ' 9.44

    Dim gotoZ As Integer = &H941004 ' 9.44

    Dim BattleListStart As Integer = &H941008 ' 9.44

#End Region

#Region "Client Adress"

    Dim ClientStatus As Integer = &H7B5D4C ' 9.44

    Dim clickId As Integer = &H93E400 ' 9.44

#End Region

#Region "Hotkeys Adress 9.44"

    Dim HotkeyObjectStart As UInteger = &H7B5C64 ' 9.44

    Dim HotkeyObjectStep As UInteger = &H1 ' 9.44

    Dim HotkeySendAutostart As UInteger = &H7B5C14 ' 9.44

    Dim HotkeyUseTypeStart As UInteger = &H7B5B78 ' 9.44

    Dim HotkeyTextStart As UInteger = &H7B3748 ' 9.44

    Dim HotkeyMax = 36 ' 9.44

#End Region

#Region "Others Declarations"

    Public Event ConnectionStatusChanged()

    Public running As Boolean = True

    Private lastStatus As Byte

    Public HealForm As frmHealer

#End Region

    Sub New(ByVal _process As Process, ByVal mainform As ClientChooser)

	    Process = _process

	    Process.EnableRaisingEvents = True

	    Handle = Util.WinApi.OpenProcess(Util.WinApi.PROCESS_ALL_ACCESS, 0, CUInt(_process.Id))

	    AdressOffset = Process.MainModule.BaseAddress.ToInt32 - &H400000

	    Input = New InputHelper(Me)

	    Me.MainForm = mainform

	    Me.menuf = menuf

	    lastStatus = ReadByte(ClientStatus)

	    If lastStatus = 8 Then

		    mainform.CharListBox.Items.Add(Me)

	    End If

	    mainform.ClientList.Add(Process.Id)

	    Dim t As New Threading.Thread(AddressOf CheckStatus)

	    t.Start()

    End Sub

    Private Sub CheckStatus()

	    While running

		    If lastStatus = 8 Then

			    Dim currentStatus As Byte = ReadByte(ClientStatus)

			    If currentStatus <> lastStatus Then

				    lastStatus = currentStatus

				    RaiseEvent ConnectionStatusChanged()

				    Threading.Thread.Sleep(300)

			    End If

		    ElseIf lastStatus = 0 Then

			    Dim currentStatus As Byte = ReadByte(ClientStatus)

			    If currentStatus <> lastStatus Then

				    lastStatus = currentStatus

				    RaiseEvent ConnectionStatusChanged()

				    Threading.Thread.Sleep(300)

			    End If

		    End If

	    End While

    End Sub

    Public Enum HotkeyUsetype

	    Onself = 2

	    OnTarget = 1

	    WithCrosshair = 0

    End Enum

    Public Structure Hotkey

	    Dim Message As String

	    Dim UseType As HotkeyUsetype

	    Dim ItemId As Integer

	    Dim SendAuto As Byte

    End Structure

    Public Sub Sendhotkey(ByVal hotkey As Hotkey)

	    'save oldhotkey data

	    Dim hotkeyObject As Integer = ReadInt(HotkeyObjectStart)

	    Dim hotkeySendAuto As Integer = ReadInt(HotkeySendAutostart)

	    Dim hotkeyUseType As Integer = ReadInt(HotkeyUseTypeStart)

	    Dim hotkeyText As String = ReadString(HotkeyTextStart)

	    WriteInt(HotkeyObjectStart, hotkey.ItemId)

	    WriteByte(HotkeySendAutostart, hotkey.SendAuto)

	    WriteInt(HotkeyUseTypeStart, hotkey.UseType)

	    WriteString(HotkeyTextStart, hotkey.Message)

	    'execute the hotkey

	    Input.SendKey(Keys.F1)

	    'now restore the hotkey

	    WriteInt(HotkeyObjectStart, hotkeyObject)

	    WriteInt(hotkeySendAuto, hotkeySendAuto)

	    WriteInt(HotkeyUseTypeStart, hotkeyUseType)

	    WriteString(HotkeyTextStart, hotkeyText)

    End Sub

    Public Function GetPlayerAdr() As Integer

	    Dim steps As Integer = &HB0

	    Dim Max As Integer = 1300

	    Dim ends As Integer = BattleListStart + (steps * Max)

	    For i As Integer = BattleListStart To ends Step steps

		    If ReadInt(i) = ReadInt(PlayerId) Then

			    Return i

		    End If

	    Next

	    Return 0

    End Function

    Public ReadOnly Property getName() As String

	    Get

		    Return ReadString(GetPlayerAdr() + 4)

	    End Get

    End Property

    Public Function LastClickId() As Integer

	    Return ReadByte(clickId)

    End Function

    Public Function IsOnline() As Boolean

	    If ReadByte(ClientStatus) = 8 Then

		    Return True

	    End If

	    Return False

    End Function

    Public Sub FullLightOn()

	    WriteInt(GetPlayerAdr() + 124, 27)

	    WriteInt(GetPlayerAdr() + 128, 215)

    End Sub

    Public Sub FullLightOff()

	    WriteInt(GetPlayerAdr() + 0, 0)

	    WriteInt(GetPlayerAdr() + 0, 0)

    End Sub

    Public Overloads Overrides Function ToString() As String

	    If ReadByte(ClientStatus) = 8 Then

		    Return ReadString(GetPlayerAdr() + 4)

	    Else

		    Return "NotLoggedIn"

	    End If

    End Function

    Public ReadOnly Property Mana As Integer

	    Get

		    Return ReadInt(Manaadr)

	    End Get

    End Property

    Public ReadOnly Property Hp As Integer

	    Get

		    Return ReadInt(Healthadr)

	    End Get

    End Property

    Public ReadOnly Property ManaMax As Integer

	    Get

		    Return ReadInt(ManaMaxadr)

	    End Get

    End Property

    Public ReadOnly Property HpMax As Integer

	    Get

		    Return ReadInt(HealthMaxadr)

	    End Get

    End Property

#Region "Memory"

    Public Function ReadString(ByVal adr As UInteger) As String

	    Return Util.Memory.ReadString(Handle, AdressOffset + adr)

    End Function

    Public Function ReadInt(ByVal adr As UInteger) As Integer

	    Return Util.Memory.ReadInt32(Handle, AdressOffset + adr)

    End Function

    Public Function ReadByte(ByVal adr As UInteger) As Byte

	    Return Util.Memory.ReadByte(Handle, AdressOffset + adr)

    End Function

    Public Sub WriteInt(ByVal adr As UInteger, ByVal value As Integer)

	    Util.Memory.WriteInt32(Handle, AdressOffset + adr, value)

    End Sub

    Public Sub WriteByte(ByVal adr As UInteger, ByVal value As Byte)

	    Util.Memory.WriteByte(Handle, AdressOffset + adr, value)

    End Sub

    Public Sub WriteString(ByVal adr As UInteger, ByVal value As String)

	    Util.Memory.WriteString(Handle, AdressOffset + adr, value)

    End Sub

#End Region

    Private Sub Process_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles Process.Exited

	    running = False

	    ClientChooser.CharListBox.Items.Remove(Me)

	    ClientChooser.ClientList.Remove(Process.Id)

    End Sub

    Private Sub Client_ConnectionStatusChanged() Handles Me.ConnectionStatusChanged

	    If lastStatus = 0 Then

		    ClientChooser.CharListBox.Items.Remove(Me)

	    Else

		    While ReadByte(ClientStatus) <> 8

			    Threading.Thread.Sleep(100)

		    End While

		    ClientChooser.CharListBox.Items.Add(Me)

	    End If

    End Sub

End Class

no do C# retirei umas funçoes eu axo , como hotkeys e sendhotkeys :/

tk-melhor.png

KIIZH.png

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo