Initial commit: ROW Client source code

Game client codebase including:
- CharacterActionControl: Character and creature management
- GlobalScript: Network, items, skills, quests, utilities
- RYLClient: Main client application with GUI and event handlers
- Engine: 3D rendering engine (RYLGL)
- MemoryManager: Custom memory allocation
- Library: Third-party dependencies (DirectX, boost, etc.)
- Tools: Development utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 16:24:34 +09:00
commit e067522598
5135 changed files with 1745744 additions and 0 deletions

View File

@@ -0,0 +1,207 @@
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "CInputMapper"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Copyright (C) 1999-2001 Microsoft Corporation. All Rights Reserved.
'
' File: ActionMap.cls
' Content: Use DirectInput action mapper to interpret input from many devices
'
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Dim m_NumberofSemantics As Long
Dim m_diaf As DIACTIONFORMAT
Dim m_DIEnum As DirectInputEnumDevices8
Dim m_Devices(100) As DirectInputDevice8
Dim m_DeviceTypes(100) As Long
Dim m_NumDevices As Long
Dim m_DI As DirectInput8
Dim m_bInit As Boolean
Dim m_hwnd As Long
Dim m_strUserName As String
Dim m_cdParams As DICONFIGUREDEVICESPARAMS
Function GetDevice(i As Long) As DirectInputDevice8
Set GetDevice = m_Devices(i)
End Function
Function GetNumDevices() As Long
GetNumDevices = m_NumDevices
End Function
Function GetDInput() As DirectInput8
Set GetDInput = m_DI
End Function
Function ConfigureDevices(Optional bAllowEdit = False)
ReDim m_cdParams.ActionFormats(0)
ReDim m_cdParams.UserNames(0)
Dim i As Long
m_cdParams.ActionFormats(0) = m_diaf
m_cdParams.FormatCount = 1
m_cdParams.UserCount = 1
m_cdParams.UserNames(0) = m_strUserName
If bAllowEdit Then
m_DI.ConfigureDevices 0, m_cdParams, DICD_EDIT
Else
m_DI.ConfigureDevices 0, m_cdParams, DICD_DEFAULT
End If
m_diaf = m_cdParams.ActionFormats(0)
'release existing devices
For i = 1 To m_NumDevices
If Not m_Devices(i) Is Nothing Then m_Devices(i).Unacquire
Set m_Devices(i) = Nothing
Next
Set m_DIEnum = Nothing
Dim ret As Long
ret = CreateDevicesFromMAP(m_hwnd, m_strUserName, m_diaf.ActionMapName, _
m_diaf.guidActionMap, m_diaf.lGenre, m_diaf.lBufferSize, _
m_diaf.lAxisMin, m_diaf.lAxisMax)
End Function
'-----------------------------------------------------------------------------
' Name: CreateDevicesFromMap()
' Desc: Creation method for the class. Creates DInput, and enumerated (i.e.
' builds a list) of "suitable" devices. By "suitable", we mean devices
' that work with the DInput genre specified in the DIACTIONFORMAT
' structure.
'-----------------------------------------------------------------------------
Function CreateDevicesFromMAP(hWnd As Long, UserName As String, MapName As String, MapGuid As String, Genre As CONST_DIGENRE, Optional buffersize = 16, Optional AxisMin = -100, Optional AxisMax = 100) As Boolean
On Local Error Resume Next
Dim i As Long
' Copy passed in arguments for internal use.
m_hwnd = hWnd
m_strUserName = UserName
m_diaf.guidActionMap = MapGuid
m_diaf.lGenre = Genre
m_diaf.lBufferSize = buffersize
m_diaf.lAxisMax = AxisMax
m_diaf.lAxisMin = AxisMin
m_diaf.ActionMapName = MapName
'Create DInput
Dim dx As DirectX8
Set dx = New DirectX8
Set m_DI = dx.DirectInputCreate()
Set dx = Nothing
m_diaf.lActionCount = m_NumberofSemantics
' Enumerate "suitable" devices that are attached
Set m_DIEnum = m_DI.GetDevicesBySemantics(m_strUserName, m_diaf, 0)
If Err.Number <> 0 Then
CreateDevicesFromMAP = False
Exit Function
End If
Dim devinst As DirectInputDeviceInstance8
For i = 1 To m_DIEnum.GetCount
Set devinst = m_DIEnum.GetItem(i)
Set m_Devices(i) = m_DI.CreateDevice(devinst.GetGuidInstance)
m_DeviceTypes(i) = devinst.GetDevType
Set devinst = Nothing
If m_DeviceTypes(i) = DI8DEVTYPE_MOUSE Then
Dim dipl As DIPROPLONG
dipl.lHow = DIPH_DEVICE
dipl.lData = DIPROPAXISMODE_REL
m_Devices(i).SetProperty "DIPROP_AXISMODE", dipl
End If
' Obtain the action to device control mapping.
m_Devices(i).BuildActionMap m_diaf, m_strUserName, 0
' Once actions have been mapped to the device controls the app can review
' the mapping and may want to modify the map. When done, call
' SetActionMap() to put the map into effect
m_Devices(i).SetActionMap m_diaf, m_strUserName, 0
' Set the cooperative level
m_Devices(i).SetCooperativeLevel m_hwnd, DISCL_EXCLUSIVE Or DISCL_FOREGROUND
Next
m_NumDevices = m_DIEnum.GetCount
m_bInit = True
CreateDevicesFromMAP = True
End Function
'-----------------------------------------------------------------------------
' Name: ClearMap()
' Desc:
'-----------------------------------------------------------------------------
Sub ClearMap()
On Local Error Resume Next
Dim i As Long
m_NumberofSemantics = 0
ReDim m_diaf.ActionArray(0)
m_bInit = False
For i = 0 To m_NumDevices
If Not m_Devices(i) Is Nothing Then
m_Devices(i).Unacquire
Set m_Devices(i) = Nothing
End If
Next
Set m_DI = Nothing
Set m_DIEnum = Nothing
End Sub
'-----------------------------------------------------------------------------
' Name: AddAction()
' Desc:
'-----------------------------------------------------------------------------
Sub AddAction(user As Long, semantic As Long, flags As Long, strName As String)
If m_bInit Then
Debug.Print "can not add actions after CreateDevicesFromMAP has been called"
Exit Sub
End If
ReDim Preserve m_diaf.ActionArray(m_NumberofSemantics)
With m_diaf.ActionArray(m_NumberofSemantics)
.ActionName = strName
.lAppData = user
.lFlags = flags
.lSemantic = semantic
End With
m_NumberofSemantics = m_NumberofSemantics + 1
End Sub

View File

@@ -0,0 +1,334 @@
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "DInput Action Mapping"
ClientHeight = 3840
ClientLeft = 45
ClientTop = 330
ClientWidth = 4725
Icon = "ActionMap.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 256
ScaleMode = 3 'Pixel
ScaleWidth = 315
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.Frame Frame1
Height = 855
Left = 0
TabIndex = 3
Top = 3000
Width = 4695
Begin VB.Label Label2
Caption = "Pressing 'd' will allow you to view device configurations"
Height = 255
Left = 120
TabIndex = 5
Top = 480
Width = 4335
End
Begin VB.Label Label1
Caption = "Press escape to exit "
Height = 255
Left = 120
TabIndex = 4
Top = 240
Width = 4335
WordWrap = -1 'True
End
End
Begin VB.Label GameStateList
Height = 255
Index = 0
Left = 240
TabIndex = 2
Top = 360
Visible = 0 'False
Width = 3855
End
Begin VB.Label TSHIELD
Caption = "Label1"
Height = 375
Left = 3720
TabIndex = 1
Top = 5160
Width = 1215
End
Begin VB.Label TFIRE
Caption = "Label1"
Height = 255
Left = 1200
TabIndex = 0
Top = 5160
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Copyright (C) 1999-2001 Microsoft Corporation. All Rights Reserved.
'
' File: ActionMap.frm
' Content: Use DirectInput action mapper to interpret input from many devices
'
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'-----------------------------------------------------------------------------
' App-defined game actions for the DInput action mapper.
'-----------------------------------------------------------------------------
' The following constants are custom for each app, depending on what input the
' app needs. This simple sample is pretending to be a space simulator game, so
' relevant inputs are for turning left, thrusting, firing weapons, etc.. Also
' note that some constants are defines for the axes, which are for recieving
' axis data from joysticks and similiar analog devices.
Const INPUT_LEFTRIGHT_AXIS = 1
Const INPUT_UPDOWN_AXIS = 2
Const INPUT_TURNLEFT = 4
Const INPUT_TURNRIGHT = 5
Const INPUT_FORWARDTHRUST = 6
Const INPUT_REVERSETHRUST = 7
Const INPUT_FIREWEAPONS = 8
Const INPUT_ENABLESHIELD = 9
Const INPUT_DISPLAYGAMEMENU = 10
Const INPUT_QUITGAME = 11
Const kMapGuid = "{20CAA014-60BC-4399-BDD3-84AD65A38A1C}"
Const kUserName = "DInput 8 VB Sample User"
Const KGenre = DIVIRTUAL_SPACESIM
Dim m_mapper As New CInputMapper
Private Sub DeviceList_Click(Index As Integer)
End Sub
Private Sub Form_Load()
Me.Show
DefineActions
Dim i As Long
For i = 1 To 15
Load Form1.GameStateList(i)
Form1.GameStateList(i).Top = i * 20
Form1.GameStateList(i).Visible = True
Next
If Not m_mapper.CreateDevicesFromMAP(Me.hWnd, kUserName, "Semantic Mapper VB Sample", kMapGuid, KGenre) Then
MsgBox "unable to find any mappable input devices"
End
End If
Do While InputLoop()
DoEvents
Loop
m_mapper.ClearMap
End
End Sub
' The following array is the global, app-defined game actions, which map real
' device input into a semantic. The first column is the app-defined semantics
' as defined above. These are the constants the game actually sees in its
' input loop. The second column is the physical action recieved by the device
' which is to be mapped to the app-defined semantic. For instance, in the
' array below, if the user hits the "Left" key on the keyboard, the app will
' recieve an input code equal to INPUT_TURNLEFT. The last column is a text
' string that DInput uses for displaying a configuration dialog box.
Sub DefineActions()
m_mapper.ClearMap
' Device input (joystick, etc.) that is pre-defined by DInput, according
' to genre type. The genre for this app is space simulators.
With m_mapper
.AddAction INPUT_LEFTRIGHT_AXIS, DIAXIS_SPACESIM_LATERAL, 0, "Turn"
.AddAction INPUT_UPDOWN_AXIS, DIAXIS_SPACESIM_MOVE, 0, "Move"
.AddAction INPUT_FIREWEAPONS, DIBUTTON_SPACESIM_FIRE, 0, "Shoot"
.AddAction INPUT_ENABLESHIELD, DIBUTTON_SPACESIM_GEAR, 0, "Shield"
.AddAction INPUT_DISPLAYGAMEMENU, DIBUTTON_SPACESIM_DISPLAY, 0, "Display"
.AddAction INPUT_QUITGAME, DIBUTTON_SPACESIM_MENU, 0, "Quit Game"
' Keyboard input mappings
.AddAction INPUT_FORWARDTHRUST, DIKEYBOARD_UP, 0, "Forward thrust"
.AddAction INPUT_REVERSETHRUST, DIKEYBOARD_DOWN, 0, "Reverse thrust"
.AddAction INPUT_FIREWEAPONS, DIKEYBOARD_F, 0, "Fire weapons"
.AddAction INPUT_ENABLESHIELD, DIKEYBOARD_S, 0, "Enable shields"
.AddAction INPUT_DISPLAYGAMEMENU, DIKEYBOARD_D, 0, "Display game menu"
.AddAction INPUT_QUITGAME, DIKEYBOARD_ESCAPE, 0, "Quit game"
.AddAction INPUT_TURNRIGHT, DIKEYBOARD_RIGHT, 0, "Right Turn"
.AddAction INPUT_TURNLEFT, DIKEYBOARD_LEFT, 0, "Left Turn"
' Mouse input mappings
.AddAction INPUT_LEFTRIGHT_AXIS, DIMOUSE_XAXIS, 0, "Turn"
.AddAction INPUT_UPDOWN_AXIS, DIMOUSE_YAXIS, 0, "Move"
.AddAction INPUT_FIREWEAPONS, DIMOUSE_BUTTON0, 0, "Fire weapons"
.AddAction INPUT_ENABLESHIELD, DIMOUSE_BUTTON1, 0, "Enable shields"
End With
End Sub
'-----------------------------------------------------------------------------
' Name: InputLoop()
' Desc: This is the input loop for the app. Input is gathered from the DInput
' devices, and output is displayed simply in the app's window.
'-----------------------------------------------------------------------------
Function InputLoop() As Boolean
Dim didObjData As DIDEVICEOBJECTDATA
Dim strOut As String
On Local Error Resume Next
'Static state of the app's input
Static bTurningRight As Boolean
Static bReverseThrust As Boolean
Static bTurningLeft As Boolean
Static bForwardThrust As Boolean
Static bFiringWeapons As Boolean
Static bEnableShields As Boolean
Static bDisplayingMenu As Boolean
Static dwLRAxisData As Long
Static dwUDAxisData As Long
Dim nItems As Long
Dim i As Long, j As Long
Dim adod(10) As DIDEVICEOBJECTDATA
Static nItemsSave(20) As Long
Dim dev As DirectInputDevice8
For i = 1 To m_mapper.GetNumDevices()
nItems = 10
Set dev = m_mapper.GetDevice(i)
' Need to ensure that the devices are acquired, and pollable devices
' are polled.
dev.Acquire
If Err.Number <> 0 Then GoTo skipDevice
dev.Poll
If Err.Number <> 0 Then GoTo skipDevice
' This call gets the data from the i'th device
nItems = 0
nItems = dev.GetDeviceData(adod, 0)
' Get the sematics codes. The number of input events is stored in
' "nItems", and all the events are stored in the "adod" array. Each
' event has a type stored in "uAppDate", and actual data stored in
' "nData".
For j = 0 To nItems - 1
If (adod(j).lUserData = INPUT_LEFTRIGHT_AXIS) Then ' Left-right axis
' Parse the left-right axis data
dwLRAxisData = adod(j).lData
bTurningRight = False
bTurningLeft = False
Debug.Print "AXIS"
If (dwLRAxisData > 0) Then bTurningRight = True
If (dwLRAxisData < -0) Then bTurningLeft = True
ElseIf (adod(j).lUserData = INPUT_UPDOWN_AXIS) Then ' Up-down axis
' Parse the up-down axis data
dwUDAxisData = adod(j).lData
bReverseThrust = False
bForwardThrust = False
If (dwUDAxisData > 0) Then bReverseThrust = True
If (dwUDAxisData < -0) Then bForwardThrust = True
Else
' Non-axis stuff
' Non-axis data is recieved as "button pressed" or "button
' released". Parse input as such.
Dim bState As Boolean
If (adod(j).lData = &H80) Then bState = True
Debug.Print "BUTTON"
Select Case adod(j).lUserData
Case INPUT_TURNLEFT:
bTurningLeft = bState
Case INPUT_TURNRIGHT:
bTurningRight = bState
Case INPUT_FORWARDTHRUST:
bForwardThrust = bState
Case INPUT_REVERSETHRUST:
bReverseThrust = bState
Case INPUT_FIREWEAPONS:
bFiringWeapons = bState
Case INPUT_ENABLESHIELD:
bEnableShields = bState
Case INPUT_DISPLAYGAMEMENU:
bDisplayingMenu = bState
Case INPUT_QUITGAME:
InputLoop = False
Exit Function
End Select
End If
Next
skipDevice:
Err.Clear
Next
' Remove conflicts (in a game, you couldn't go left and right at the same
' time. Actual conflicts depend on the game logic, and not on the DInput
' semantic mappings.)
If (bTurningLeft And bTurningRight) Then
bTurningLeft = False: bTurningRight = False
End If
If (bForwardThrust And bReverseThrust) Then
bForwardThrust = False: bReverseThrust = False
End If
If (bFiringWeapons And bEnableShields) Then bFiringWeapons = False
' The remainder of the this function is simply to output the results of
' gathering the input.
GameStateList(1).Caption = "Turning Left " + Str(bTurningLeft)
GameStateList(2).Caption = "Turning Right " + Str(bTurningRight)
GameStateList(3).Caption = "Forward thrust " + Str(bForwardThrust)
GameStateList(4).Caption = "Backward thrust " + Str(bReverseThrust)
GameStateList(5).Caption = "Firing Weapons " + Str(bFiringWeapons)
GameStateList(6).Caption = "Enable Shields" + Str(bEnableShields)
GameStateList(7).Caption = "LR Axis " + Str(dwLRAxisData)
GameStateList(8).Caption = "UD Axis " + Str(dwUDAxisData)
If (bDisplayingMenu) Then
m_mapper.ConfigureDevices True
bDisplayingMenu = False
End If
InputLoop = True
End Function
Private Sub Form_Unload(Cancel As Integer)
End
End Sub

View File

@@ -0,0 +1,35 @@
Type=Exe
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#stdole2.tlb#OLE Automation
Reference=*\G{E1211242-8E94-11D1-8808-00C04FC2C603}#1.0#0#dx8vb.dll#DirectX 8 for Visual Basic Type Library
Form=ActionMap.frm
Class=CInputMapper; ActionMap.cls
Startup="Form1"
ExeName32="vb_ActionMapper.exe"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Microsoft"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1

View File

@@ -0,0 +1,2 @@
Form1 = -17, 13, 520, 457, C, 44, 44, 581, 488, C
CInputMapper = 88, 88, 625, 532, C

View File

@@ -0,0 +1,38 @@
//-----------------------------------------------------------------------------
// Name: ActionMap DirectInput Sample
//
// Copyright (C) 1999-2001 Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
Description
===========
The ActionMap sample illustrates the use of DirectInput's Action Mapping feature.
This feature allows you to assign various keys to constants that are kept in
a queue that the application can read at any time. This sample also shows how
those mappings can be user configurable.
Path
====
Source: DXSDK\Samples\Multimedia\Vbsamples\DirectInput\ActionMap
Executable: DXSDK\Samples\Multimedia\vbsamples\DirectInput\Bin
User's Guide
============
None
Programming Notes
=================
ActionMap.cls should not be used unmodified. For the purpose of this sample it will
query for any and all input devices and does not differentiate where the input is coming
from. Most applications will want to modify the class to respond to only one given input
or differentiate the input devices into different players or purposes.
This sample makes use of common DirectX code (consisting of helper functions,
etc.) that is shared with other samples on the DirectX SDK. All common
classes and modules can be found in the following directory:
DXSDK\Samples\Multimedia\VBSamples\Common