This commit is contained in:
zongor 2023-10-31 19:11:48 -04:00
commit f71692478a
8 changed files with 4 additions and 23 deletions

View File

@ -53,7 +53,7 @@ program main
call me%sync_camera(camera) call me%sync_camera(camera)
time = get_time() time = get_time()
if (modulo(time, 1.0) .ge. 0.58_c_double) then if (modulo(time, 1.0) .ge. 0.98_c_double) then
if (player_updated) then if (player_updated) then
players = me%move() players = me%move()
else else

1
fortran/client/install.sh Executable file
View File

@ -0,0 +1 @@
fpm install --flag '-fno-range-check'

View File

@ -107,7 +107,7 @@ contains
call json%add(user, 'username', local_username) call json%add(user, 'username', local_username)
call json%add(user, 'x_pos', this%position%x) call json%add(user, 'x_pos', this%position%x)
call json%add(user, 'y_pos', this%position%y) call json%add(user, 'y_pos', this%position%z)
call json%add(user, 'command', request_type) call json%add(user, 'command', request_type)
call json%add(root, user) call json%add(root, user)
@ -167,7 +167,7 @@ contains
if (request_type .eq. 1) then if (request_type .eq. 1) then
print *, 'login, setting pos' print *, 'login, setting pos'
this%position%x = x_pos this%position%x = x_pos
this%position%y = y_pos this%position%z = y_pos
print *, x_pos, y_pos print *, x_pos, y_pos
print *, 'login, setting apperance' print *, 'login, setting apperance'

View File

@ -1,5 +0,0 @@
program check
implicit none
print *, "Put some tests in here!"
end program check

View File

@ -119,7 +119,6 @@ contains
end function db_add_user end function db_add_user
integer function db_delete_user(db, username) result(rc) integer function db_delete_user(db, username) result(rc)
!! Adds student to database.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
character(len=*), intent(in) :: username character(len=*), intent(in) :: username
type(c_ptr) :: stmt type(c_ptr) :: stmt
@ -141,7 +140,6 @@ contains
end function db_delete_user end function db_delete_user
integer function db_get_logged_in_users(db, connection) result(rc) integer function db_get_logged_in_users(db, connection) result(rc)
!! Prints number of courses per student to standard output.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
integer(c_int), intent(inout) :: connection integer(c_int), intent(inout) :: connection
character(len=*), parameter :: TCP_SUFFIX = c_carriage_return // c_new_line // c_null_char character(len=*), parameter :: TCP_SUFFIX = c_carriage_return // c_new_line // c_null_char
@ -274,7 +272,6 @@ contains
end function db_move_user end function db_move_user
subroutine db_error(code, proc, err_msg) subroutine db_error(code, proc, err_msg)
!! Prints error message.
integer, intent(in) :: code integer, intent(in) :: code
character(len=*), intent(in), optional :: proc character(len=*), intent(in), optional :: proc
character(len=*), intent(in), optional :: err_msg character(len=*), intent(in), optional :: err_msg

View File

@ -1,3 +1,2 @@
#!/bin/sh #!/bin/sh
#listen1 'tcp!*!35565'
~/.local/bin/fortran-mmo-server ../../common/sql/test.db3 ~/.local/bin/fortran-mmo-server ../../common/sql/test.db3

View File

@ -1,7 +0,0 @@
program main
use iso_fortran_env
implicit none
write(output_unit, "(i3, 1x, a24, 1x, f8.2, 1x, f8.2)") 0, 'chakr', 0.0, 0.0
end program main

View File

@ -72,7 +72,6 @@ contains
integer function db_add_user(db, username, password, apperance_r, apperance_g, apperance_b, & integer function db_add_user(db, username, password, apperance_r, apperance_g, apperance_b, &
x_pos, y_pos, logged_in, created) result(rc) x_pos, y_pos, logged_in, created) result(rc)
!! Adds student to database.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
character(len=*), intent(in) :: username character(len=*), intent(in) :: username
character(len=*), intent(in) :: password character(len=*), intent(in) :: password
@ -120,7 +119,6 @@ contains
integer function db_delete_user(db, username) result(rc) integer function db_delete_user(db, username) result(rc)
!! Adds student to database.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
character(len=*), intent(in) :: username character(len=*), intent(in) :: username
type(c_ptr) :: stmt type(c_ptr) :: stmt
@ -142,7 +140,6 @@ contains
end function db_delete_user end function db_delete_user
integer function db_count_logged_in_users(db) result(rc) integer function db_count_logged_in_users(db) result(rc)
!! Prints number of courses per student to standard output.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
type(c_ptr) :: stmt type(c_ptr) :: stmt
@ -173,7 +170,6 @@ contains
end function db_count_logged_in_users end function db_count_logged_in_users
integer function db_get_logged_in_users(db) result(rc) integer function db_get_logged_in_users(db) result(rc)
!! Prints number of courses per student to standard output.
type(db_type), intent(inout) :: db type(db_type), intent(inout) :: db
type(c_ptr) :: stmt type(c_ptr) :: stmt