Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Map Report


emblem
 Share

Recommended Posts

One thing me and my friends loved about eclipse was it's Map Report functionality, you could simply open up the map report and it would give you a summary of your entire game _and_ allow you to warp to any of the maps.

When I found out that map report didn't work on Origins, I decided to re-code it.

_Once you finish this tutorial, typing /mapreport will bring up a summary of all the maps. Double clicking on a map or pressing the "Warp to!" button will warp you to that map._

Let's begin with the server, because it's easier.
Server Side
**Find this:** (modEnumerations » Enum ServerPackets)
```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT

```
**Above it, add this:**
```
    SMapReport

```

**Find this:** (modHandleData » Sub HandleMapReport)
```
Sub HandleMapReport(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

```
**Replace the entire sub with this:**
```
    Dim i As Long
    Dim Buffer As clsBuffer

    ' Prevent hacking
    If GetPlayerAccess(Index) < ADMIN_MAPPER Then
        Exit Sub
    End If

    Set Buffer = New clsBuffer
    Buffer.WriteLong SMapReport

    For i = 1 To MAX_MAPS
        Buffer.WriteString Trim$(Map(i).Name)
    Next

    SendDataTo Index, Buffer.ToArray()
    Set Buffer = Nothing
End Sub

```

Now the client, almost there!
Client Side
**Find this:** (modEnumerations » Enum ServerPackets)
```
    ' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT

```
**Above it, add this:**
```
    SMapReport

```

**Find this:** (modHandleData » Sub InitMessages)
```
    HandleDataSub(STradeStatus) = GetAddress(AddressOf HandleTradeStatus)

```
**Below it, add this:**
```
    HandleDataSub(SMapReport) = GetAddress(AddressOf HandleMapReport)

```

**At the end of modHandleData, add this:**
```
Private Sub HandleMapReport(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer
    Dim MapNum As Integer

    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()

    frmMapReport.lstMaps.Clear

    For MapNum = 1 To MAX_MAPS
        frmMapReport.lstMaps.AddItem MapNum & ": " & Buffer.ReadString
    Next MapNum

    frmMapReport.Show

    Set Buffer = Nothing
End Sub

```

**Find this:** (modInput » Sub HandleKeyPresses)
```
                Case "/mapreport"

```
**Replace the entire case with:**
```
                Case "/mapreport"

                    If GetPlayerAccess(MyIndex) < ADMIN_MAPPER Then
                        AddText "You need to be a high enough staff member to do this!", AlertColor
                        GoTo Continue
                    End If

                    SendMapReport

```

**Find this:** (frmMainGame » Sub cmdAMapReport_Click)
```
Private Sub cmdAMapReport_Click()

```
**Replace the entire sub with this:**
```
Private Sub cmdAMapReport_Click()
    If GetPlayerAccess(MyIndex) < ADMIN_MAPPER Then
        AddText "You need to be a high enough staff member to do this!", AlertColor
        Exit Sub
    End If

    SendMapReport
End Sub

```
**At the end of modClientTCP, add this:**
```
Public Sub SendMapReport()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
    Buffer.WriteLong CMapReport
    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub

```
**Finally:** Download the attached form and place it in your source directory, then add it to the client project.

![](http://img806.imageshack.us/img806/1365/previewj.png)

Yes, I tried to steel ballies tutorial format. =D
Link to comment
Share on other sites

  • 1 month later...
Hello Tylian,

Because it's an error related to your tutorial, I'll ask it here:

After adding your code neatly into the server & client source, I got the Compilation Error inside the Origins 1.1.0 Client source:

It says  "Compile Error: Variable not defined"  highlighting the "frmMapReport" bit, in:

```
frmMapReport.lstMaps.Clear
```

Oh, and I have put the frmMapReport.frm file into the client side source folder.

Any idea..?
Link to comment
Share on other sites

Well I just used a new clean EO 1.1.0 server & client source, opened up the server & client source with VB6, and added the codings exactly as it is it's instructed in the tutorial. Reason for using a clean source, is just that I wanted to see if this mapreport feature would work at all in 1.1.0.
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
@Robin:

> Lol. Coulda sworn I had a /mapreport command in. Typed it out and was greeted with "Convert this to Byte Array, Robin!".
>
> It's nice to know that my past self leaves me helpful remarks.

Wuts the point in that anyways?
Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...